<template>
  <div>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="通知标题">
        <el-input v-model="form.AlertsTitle"></el-input>
      </el-form-item>
      <el-form-item label="通知内容">
        <el-input type="textarea" v-model="form.AlertsContent"></el-input>
      </el-form-item>
      <el-form-item label="学生可见">
        <el-switch v-model="form.StudentShow"></el-switch>
      </el-form-item>
      <el-form-item label="通知类型">
        <el-checkbox-group v-model="form.type">
          <el-checkbox name="type"></el-checkbox>
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option
              v-for="item in notice"
              :label="item.NoticeName"
              :value="item.NoticeId"
              :key="item.NoticeId"
            ></el-option>
          </el-select>
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="特殊资源">
        <el-radio-group v-model="form.resource">
          <el-radio label="线上品牌商赞助"></el-radio>
          <el-radio label="线下场地免费"></el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="活动形式">
        <el-input type="textarea" v-model="form.desc"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即创建</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      notice: "",
      form: {
        AlertsTitle: "",
        AlertsContent: "",
        StudentShow: false,
        type: [],
        resource: "",
        desc: ""
      }
    };
  },
  created() {
    this.getAllNotice();
  },
  mounted() {},
  methods: {
    getAllNotice() {
      this.$axios({
        method: "get",
        url: this.$api.GetAllNotice
      }).then(res => {
        this.notice = res.data.message;
      });
    },
    onSubmit() {
      console.log("submit!");
    }
  }
};
</script>

<style scoped>
</style>
